import { NgModule, ModuleWithProviders } from "@angular/core";
import { CommonModule } from "@angular/common";
import { Iwe7UrlService, ENV } from "./iwe7-url.service";
import { HttpClientModule } from "@angular/common/http";

@NgModule({
  imports: [CommonModule, HttpClientModule],
  declarations: []
})
export class Iwe7ToolsModule {
  public static forRoot(env: any): ModuleWithProviders {
    return {
      ngModule: Iwe7ToolsModule,
      providers: [
        {
          provide: ENV,
          useValue: env
        },
        Iwe7UrlService
      ]
    };
  }

  public static forChild(): ModuleWithProviders{
    return {
      ngModule: Iwe7ToolsModule,
      providers: [
        Iwe7UrlService
      ]
    };
  }
}
